﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using ComponentsLib;
using System.Xml;

namespace eKanBan.View.MemberGUI
{
    public partial class MemberGUI : BaseUIControl
    {
        private readonly int fixedWidth;
        private readonly int fixedHeight;
        private void CreateControlShape(Image Shape)
        {
            CreateControlShape(Shape, fixedWidth, fixedHeight, new Color());
            using (System.Drawing.Drawing2D.GraphicsPath circlepPath = new System.Drawing.Drawing2D.GraphicsPath())
            {
                circlepPath.AddPie(0, 0, fixedWidth, fixedHeight, 0, 360);
                System.Drawing.Region g = new Region(circlepPath);
                g.Intersect(Region);
                Region = g;
            }
        }
        public MemberGUI()
        {
            InitializeComponent();
            fixedWidth = 75;
            fixedHeight = 75;
            base.Movable = true;
            base.Resizable = true;
            CreateControlShape(pictureEdit1.Image);
        }

        protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
        {
            base.SetBoundsCore(x, y, fixedWidth, fixedHeight, specified);
        }

        public override bool Movable
        {
            get
            {
                return base.Movable;
            }
            set
            {
            }
        }

        public override bool Resizable
        {
            get
            {
                return base.Resizable;
            }
            set
            {
            }
        }

        private void pictureEdit1_ImageChanged(object sender, EventArgs e)
        {
            CreateControlShape(pictureEdit1.Image);
        }
    }
}
